﻿#pragma once
#include "ZuiLib.h"
#include "LRefObject.h"

namespace ZuiLib {

class LButton :public LRefObject<ZButton>
{
public:
	int getNormalImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetNormalImage());
	}

	int setNormalImage(LuaFuncState& L)
	{
		pThis->SetNormalImage(L.arg(0).toString());
		return 0;
	}

	int getHotImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetHotImage());
	}

	int setHotImage(LuaFuncState& L)
	{
		pThis->SetHotImage(L.arg(0).toString());
		return 0;
	}

	int getPushedImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetPushedImage());
	}

	int setPushedImage(LuaFuncState& L)
	{
		pThis->SetPushedImage(L.arg(0).toString());
		return 0;
	}

	int getFocusedImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetFocusedImage());
	}

	int setFocusedImage(LuaFuncState& L)
	{
		pThis->SetFocusedImage(L.arg(0).toString());
		return 0;
	}

	int getDisabledImage(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetDisabledImage());
	}

	int setDisabledImage(LuaFuncState& L)
	{
		pThis->SetDisabledImage(L.arg(0).toString());
		return 0;
	}

	int getHotTextColor(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetHotTextColor());
	}

	int setHotTextColor(LuaFuncState& L)
	{
		pThis->SetHotTextColor(toColor(L.arg(0)));
		return 0;
	}

	int getPushedTextColor(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetPushedTextColor());
	}

	int setPushedTextColor(LuaFuncState& L)
	{
		pThis->SetPushedTextColor(toColor(L.arg(0)));
		return 0;
	}

	int getFocusedTextColor(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetFocusedTextColor());
	}

	int setFocusedTextColor(LuaFuncState& L)
	{
		pThis->SetFocusedTextColor(toColor(L.arg(0)));
		return 0;
	}

	BEGIN_MAP_FUNC(LButton)
		DECLARE_FUNC(getNormalImage),
		DECLARE_FUNC(setNormalImage),
		DECLARE_FUNC(getHotImage),
		DECLARE_FUNC(setHotImage),
		DECLARE_FUNC(getPushedImage),
		DECLARE_FUNC(setPushedImage),
		DECLARE_FUNC(getFocusedImage),
		DECLARE_FUNC(setFocusedImage),
		DECLARE_FUNC(getDisabledImage),
		DECLARE_FUNC(setDisabledImage),
		DECLARE_FUNC(getHotTextColor),
		DECLARE_FUNC(setHotTextColor),
		DECLARE_FUNC(getPushedTextColor),
		DECLARE_FUNC(setPushedTextColor),
		DECLARE_FUNC(getFocusedTextColor),
		DECLARE_FUNC(setFocusedTextColor),
	END_MAP_FUNC
};

}//namespace
